//
//  ImageView.m
//  06-模仿ImageView
//
//  Created by J on 15/11/15.
//  Copyright © 2015年 JZJ. All rights reserved.
//

#import "ImageView.h"

@implementation ImageView


// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.

- (void)setImage:(UIImage *)image{
    
    _image = image;
    [self setNeedsDisplay];//调用setNeedsDisplay会自动调用drawRect
    
}

- (void)drawRect:(CGRect)rect {
    
    [_image drawInRect:rect];

    
}


@end
